feat: Change default listen address to 0.0.0.0#2307
feat: Change default listen address to 0.0.0.0#2307simon-lemay-unity merged 15 commits intodevelopfrom
Conversation
…nsportTests.cs Co-authored-by: Jesse Olmer <jesseo@unity3d.com>
…sport.cs Co-authored-by: Jesse Olmer <jesseo@unity3d.com>
| { | ||
| get | ||
| { | ||
| if (ServerListenAddress?.Length == 0) |
There was a problem hiding this comment.
Won't this log Debug.LogError($"Invalid network endpoint: {ip}:{port}."); in the case where the server listen address is empty?
I don't see an actual test case for this conditional - do we have one for an empty address versus a malformed one?
There was a problem hiding this comment.
Rather, line 339 (accessing ServerEndPoint) would log this in this case.
There was a problem hiding this comment.
Yes, if both the 'Address' and 'Listen Address' fields are left empty, it will log an error. Although that scenario was never supported before. The previous behavior if leaving 'Listen Address' empty was to use 'Address'. I can add a special case where if both are left empty, we revert to 0.0.0.0 as the listen address.
There are no specific tests for leaving the listen address empty, but that is what a lot of tests actually end up doing, since it's the default when calling SetConnectionData without explicitly setting a listen address.
There was a problem hiding this comment.
Pushed a change that avoids an error if both 'Address' and 'Listen Address' are empty (we'll then default to 0.0.0.0). Also added a test case for this particular scenario.
This reverts commit d48c373.
Change the default listen address to 0.0.0.0, instead of falling back on the 'Address' field. This should simplify things for users setting up connections to other machines, since the default will now be what you usually want for a server.
Changelog
UnityTransportis now 0.0.0.0.Testing and Documentation